package leecode

func calculateDepth(root *TreeNode) (result int) {
	if root == nil {
		return
	}
	//当前节点左子树深度
	leftDfs := calculateDepth(root.Left)
	//当前节点右子树深度
	rightDfs := calculateDepth(root.Right)
	result = max(leftDfs, rightDfs) + 1
	return
}
